const ejs = require('ejs');
const fs = require('fs');

const str = ejs.renderFile('./views/1.ejs', {
    name: 'lbj'
}, (err, data) => {
    if (err) {
        console.log('编译失败');
    } else{
        console.log(data);
    }
});

fs.writeFile('./build/1.html', str, (err) =>{
    if (err) {
        console.log('写入失败');
    } else {
        console.log('写入失败')
    }
});